package com.research.performace.entities.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="tblsystemvalues")
public class SystemValue implements Serializable {
	
	private static final long serialVersionUID = 1L;

	public enum TableName {
		CHANNEL("CHANNEL"), PAYMENT_MODE("PAYMENT_MODE"), DELIVERY_MODE("DELIVERY_MODE"), 
		OFFER_CATEGORIES("OFFER_CATEGORIES"), FAMILY_CODE("FAMILY_CODE"), CURRENCY("CURRENCY"), 
		COUNTRY("COUNTRY"), LANGUAGE("LANGUAGE"), SUB_FAMILY_CODE("SUB_FAMILY_CODE");

        private String value;

        TableName(String value) {
        	this.value = value;
        }

        public String getValue() {
        	return value;
        }

        public static TableName parse(String id) {
        	TableName tableName = null; // Default
            for (TableName item : TableName.values()) {
                if (item.getValue().equals(id)) {
                	tableName = item;
                    break;
                }
            }
            return tableName;
        }

    };
	
	@Id
	@Column(name="id")
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer systemValueId;
	
	@Column(name = "system_code")
	private String systemCode;
	
	@Column(name = "system_name")
	private String systemName;

	public Integer getSystemValueId() {
		return systemValueId;
	}

	public void setSystemValueId(Integer systemValueId) {
		this.systemValueId = systemValueId;
	}

	public String getSystemCode() {
		return systemCode;
	}

	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}

	public String getSystemName() {
		return this.systemName;
	}

	public void setSystemName(TableName tableName) {
		this.systemName = tableName.toString();
	}
	
}